from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin


class Entry(models.Model):
    name = models.CharField(max_length=40)
    number_volunteers = models.IntegerField()	
    address = models.CharField(max_length=1000)
    city = models.CharField(max_length=50)
    county = models.CharField(max_length=50)
    email = models.CharField(max_length=100)
    crop_type = models.CharField(max_length = 100)
    date = models.DateField(blank=True)
    start_time = models.DateTimeField()
    instructions = models.TextField()
    remind = models.BooleanField(default=False)
    
    def __str__(self):
        return self.name
    
    class Meta:
        verbose_name_plural = "entries"   
        

class CommonMedia:
    js = (
        'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',
        '/static/js/editor.js',
    )
    css = {
        'all': ('/static/css/editor.css',),
    }
    
### Admin

class EntryAdmin(admin.ModelAdmin):
    list_display = ["name", "number_volunteers", "address", "city", "county", "email", "crop_type", "date", "start_time", "instructions"]
